package com.jxud.utils;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jxud.enums.SensitiveTypeEnum;
import com.jxud.filter.SensitiveDataSerializer;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside // 让自定义序列化器生效
@JsonSerialize(using = SensitiveDataSerializer.class) // 关键：指定序列化器
public @interface SensitiveData {
    SensitiveTypeEnum type();
}
